﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Kevin.Framework.Data.OrmMapping;
using Kevin.Framework.Validation;
using Kevin.Framework.Data.Query;

namespace WebTest
{
    [Serializable]
    [TableMapping("TU_Action")]
    public class TU_ActionInfo:EntityBase
    {
        public TU_ActionInfo():this("")
        { }
        public TU_ActionInfo(string connKey)
            : base(connKey)
        { }
        int _id;
        [AutoIncrement()]
        [FieldMapping("ID", PrimaryKey = true)]        
        public int ID
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
                base.OnPropertyChanged("ID", _id, value);
            }
        }

        int _actionID;
        [FieldMapping("ActionID")]
        [NotNullValidator(MessageTemplate="ID不能为空")]
        public int ActionID
        {
            get 
            {
                return _actionID;
            }
            set 
            {
                _actionID = value;
                base.OnPropertyChanged("ActionID", _id, value);
            }
        }        
        string _name = "";
        [FieldMapping("ActionName")]
        public string ActionName
        {
            get {
                return _name;
            }
            set {
                _name = value;
                base.OnPropertyChanged("ActionName", _name, value);
            }
        }
        string _desc;
        [FieldMapping("ActionDesc")]  
        public string ActionDesc
        {
            get
            {
                return _desc;
            }
            set
            {
                _desc = value;
                OnPropertyChanged("ActionDesc", _desc, value);
            }
        }
        
    }

    public class TUActionBLL : IQueryTable
    {
        public QueryColumn ActionID { get; set; }
        public QueryColumn ActionName { get; set; }
        public QueryColumn ActionDesc { get; set; }

        string IQueryTable.TableName
        {
            get { throw new NotImplementedException(); }
        }

        string IQueryTable.AliasName
        {
            get { throw new NotImplementedException(); }
        }

        string IQueryTable.___GetTableName()
        {
            throw new NotImplementedException();
        }
    }
}